var express = require('express')
var router = express.Router()
const { SysDeptController } = require('../controller/sys_dept')
const passport = require('passport')
const { auth } = require('../middleware/auth')
router.get(
  '/dept/list',
  passport.authenticate('jwt', { session: false }),
  auth,
  SysDeptController.getDeptList
)
router.get(
  '/dept/tree',
  passport.authenticate('jwt', { session: false }),
  auth,
  SysDeptController.getDeptTree
)
router.post(
  '/dept/add',
  passport.authenticate('jwt', { session: false }),
  auth,
  SysDeptController.addDept
)
router.put(
  '/dept/edit',
  passport.authenticate('jwt', { session: false }),
  auth,
  SysDeptController.editDept
)
router.delete(
  '/dept/del',
  passport.authenticate('jwt', { session: false }),
  auth,
  SysDeptController.delDept
)
module.exports = router
